<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
    <title>现金转账</title>
    <meta content="" name="keywords">
    <meta content="" name="description">
    <script src="js/rem.js"></script>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <link href="css/base.css" rel="stylesheet" type="text/css"/>
    <link href="css/page.css" rel="stylesheet" type="text/css"/>
    <link href="css/all.css" rel="stylesheet" type="text/css"/>
    <link href="css/mui.min.css" rel="stylesheet" type="text/css"/>
    <link href="css/loaders.min.css" rel="stylesheet" type="text/css"/>
    <link href="css/loading.css" rel="stylesheet" type="text/css"/>
    <link href="slick/slick.css" rel="stylesheet" type="text/css"/>
    <link href="css/mui.picker.min.css" rel="stylesheet" type="text/css"/>
    <link href="css/mui.picker.css" rel="stylesheet"/>
    <script type="text/javascript">
        $(window).load(function () {
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
        });

        $(function () {
            $.ajax({
                url: 'api/balance/query',
                type: 'POST',
                headers: {
                    'AccessToken': window.localStorage.getItem('AccessToken')
                },
                data: {
                    type: 0
                },
                success: function (result) {
                    $('#cashBalance').text(result.data);
                }
            });
        });

        function verifyRecharge() {
            let rechargeAmount = $('#rechargeCash').val();
            let payMode = $('#payMode').attr('value');
            $.ajax({
                url: 'api/balance/balanceChange',
                type: 'POST',
                headers: {
                    'AccessToken': window.localStorage.getItem('AccessToken')
                },
                data: {
                    amount: rechargeAmount,
                    type: 0
                },
                success: function (result) {
                    $('#cashBalance').text(result.data);
                }
            });
        }

        function changeNumber(val) {
            if (val < 0) {
                $('#rechargeCash').val(0);
            }
        }
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<!--header star-->
<header class="mui-bar mui-bar1 mui-bar-nav mui-bar-nav1" id="header">
    <a class="btn" href="javascript:history.go(-1)">
        <i class="iconfont icon-fanhui"></i>
    </a>
    <div class="top-sch-box top-sch-boxtwo top-sch-boxthree flex-col">
        返回
    </div>
</header>
<!--header end-->
<div class="warp warpthree clearfloat">
    <div class="h-top h-topone clearfloat box-s">
        <p id="cashBalance"></p>
        <span>账户余额(元)</span>
    </div>
    <div class="recharge clearfloat">
        <div class="czhi clearfloat box-s">
            <p>充值金额</p>
            <input id="rechargeCash" min="1" onfocusout="changeNumber(this.value)" placeholder="请输入金额" type="number"/>
            <span>元</span>
        </div>
        <div class="czhi clearfloat box-s" id='showUserPicker'>
            <p>支付方式</p>
            <p id="payMode" value="0">支付宝</p>
            <i class="iconfont icon-xiala fr"></i>
        </div>
        <div class="bottom clearfloat">
            <a class="db fl btn ra3" onclick="verifyRecharge()">确定</a>
            <a class="db fr btn ra3" href="javascript:history.go(-1)">取消</a>
        </div>
    </div>
</div>
</body>
<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="js/mui.min.js"></script>
<script src="js/mui.picker.min.js"></script>
<script src="js/others.js"></script>
<script src="js/hmt.js" type="text/javascript"></script>
<script src="slick/slick.js" type="text/javascript"></script>
<!--插件-->
<link href="css/swiper.min.css" rel="stylesheet">
<script src="js/swiper.jquery.min.js"></script>
</html>
